<?php
namespace Admin\Controller;

use Think\Controller;

class IndexController extends Controller
{
    const USER = "member";
    const CONPUN = "coupon";
    private static $COUPON = 2;

    public function index()
    {
        $this->findAll("ytmfdw_member");
        $this->show("大爷，来玩玩~");
    }

    private function db($type, $db_config)
    {
        $form = M($type, null, $db_config);
        return $form;
    }

    private function findAll($type)
    {
        $sql = "SELECT * FROM " . $type;
        echo $sql;
        echo "<br>";
        $Form = $this->db($type, "DB_COUPON")->query($sql);
        dump($Form);
        $this->assign('list', $Form);
    }
}